<!DOCTYPE HTML>
%html
  %head
    %title=action_name

  %body
    %header
      - if @email.nil?
        %p.error no emails sent
      - else
        - if @scenario
          .i18n-params{style: 'display: none'}
            .group= @scenario[:group]&.name
            .discussion= @scenario[:discussion]&.title
            .actor= @scenario[:actor]&.name
            .poll= @scenario[:poll]&.title
            .title= @scenario[:poll]&.title
            .poll_type= t("poll_types.#{@scenario[:poll]&.poll_type}")

        %table
          %tr
            %td To
            %td= Array(@email.to).join(', ')
          %tr
            %td From
            %td= Array(@email.from).join(', ')
          %tr
            %td Subject
            %td= @email.subject
          %tr
            %td Reply to
            %td= Array(@email.reply_to).join(', ')
        %hr
        %main{style:"margin: 8px"}=  raw @email.body.parts.last.decoded
